/**
 * Created with Vim7.3 ubuntu12.04
 * @fileOverview : 
 * @author : Lyle <lylechen2014@gmial.com>
 * @since : 2014-08-25 13:07:58
 * @filename : static/mnm/src/views/userList.js
 * @version : 
 * @description : 
 */

define(function(require, exports, module){

        require("{resourceUrl}css/mnm/public.css");
        require("{resourceUrl}css/mnm/share.css");

        var userListView,nav='search',
            $ = require('$'),
            _ = require('underscore'),
	    Backbone = require('backbone'),
            lang = require('{baseSea}I18N/mnm/{locale}'),
            panel = require('{baseSea}panel/zepto.panel'),

            tpl = require('{resourceUrl}tpl/mnm/userList.tpl'),
            tplN = require('{resourceUrl}tpl/mnm/userNav.tpl');
	
        userListView = Backbone.View.extend({

                el: 'body',
 
		template: _.template(tpl),
		templateN: _.template(tplN),

		initialize: function () {
                
                },

		render: function (obj) {
                    if ($('#userList').length < 1) { 
                        $('body').append(this.template(lang));
                        $('#userList').append(this.templateN(lang)); 
                        this.bindEvt();
                        this.panelInit(); 
                    } else {
		        $('#userList').show();
                    }
                },

                bindEvt : function() {
                    var tthis = this;
                    $('#userList').find('.userList').tap(function(){
                        if (panel.info.state == 'hidden') {         
                           alert('li');
                        }
                    });
                },


                panelInit : function() {
                    panel.init({
                         state : 'hidden', 
                         navName : nav,
                         rootDom : $('#userList'),
                         contentDom : $('#userList').find('.body_all'),
                         navDom : $('#userList').find('.userNav')
                    });        
                }
	});

	module.exports = userListView;
})

